package com.ybb.vue.domain;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author ybb
 * @version 1.0
 * @Description 健康码状态枚举类
 * @Date 2023/3/11 19:20
 */

@Getter
@AllArgsConstructor
public enum HealthStatusEnum {
    GREEN_CODE("0","绿码"),
    YELLOW_CODE("1","黄码"),
    RED_CODE("2","红码"),
    UNKNOWN_HEALTH_CODE("3","未知弹窗"),
    NO_HEALTH_CODE("4","未申请健康码"),
    DEFAULT_CODE("-1","待更新健康码信息")
    ;
    private String status;

    private String statusDesc;

    public static String getHealthStatus(String code){
        for (HealthStatusEnum it : HealthStatusEnum.values()) {
            if (it.status.equals(code)) {
                return it.statusDesc;
            }
        }
        return DEFAULT_CODE.statusDesc;
    }
}
